package com.jhl.seckill.config;


import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;


/**
 * 限流配置
 */
@Component
public class MyKeyResolver {

    @Bean
    public KeyResolver ApiKeyResolver() {
        return exchange -> Mono.just(exchange.getRequest().getPath().value());

    }


}
